package de.homelabs.modules.template.service;

import java.io.Reader;
import java.util.List;

import de.homelabs.modules.template.domain.HLTemplateElement;

public interface IHLTemplateManager {

	/**
	 * setter for manual set template List
	 * @param templateList
	 */
	public void setTemplateList(List<HLTemplateElement> templateList);
	
	/**
	 * getter for template list
	 * @return
	 */
	public List<HLTemplateElement> getTemplateList();
	
	/**
	 * returns if found a HLTemplateElement by its templat key
	 * 
	 * @param templateKey - Key of the Template
	 * @return HLTemplateElement
	 */
	public HLTemplateElement findTemplate(String templateKey);
	
	/**
	 * returns a reader for the Template element source, uses for Freemarker Template loader
	 * 
	 * @param HLTemplateElement
	 * @return Reader
	 */
	public Reader getTemplateReader(HLTemplateElement templateElement);
	
	/**
	 * try to close a previous opened file reader
	 * @param HLTemplateElement
	 * @return boolean
	 */
	public boolean closeTemplateReader(HLTemplateElement templateElement);
}
